﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using AngleSharp.Html.Parser;
using Newtonsoft.Json;
using WeihanLi.Common.Helpers;
using WeihanLi.Common.Log;
namespace NetEaseVipDefense.Model
{
    public class ProxyHelper
    {
        private const string iptxt = "newIp.txt";
        public static int i { get; set; }
        private static List<string> IpList { get; set; }
        public static List<string> GetProxyIps()
        {
            if (IpList == null)
            {
                IpList = new List<string>();
                var ips = File.ReadAllLines(iptxt).ToList();
                foreach (var ip in ips)
                {
                    IpList.Add(ip.Replace(",", ":"));
                    Console.WriteLine(ip);
                }
            }
            return IpList;
        }

        public static string GetNextProxy()
        {
            return GetProxyIps()[i++];
        }
    }

}
